home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Controls
/
Visual Basic Controls.iso
/
vbcontrol
/
polardrw
/
data.z
/
frmGrid.frm
< prev
next >
Wrap
Text File
|
1999-04-29
|
6KB
|
185 lines
VERSION 5.00
Object = "{9D74B104-40BE-11D2-AA5F-008048E292F1}#1.0#0"; "COLORSELECT.OCX"
Begin VB.Form frmGrid
BorderStyle = 1 'Fixed Single
Caption = "Grid settings"
ClientHeight = 2115
ClientLeft = 45
ClientTop = 330
ClientWidth = 4740
Icon = "frmGrid.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2115
ScaleWidth = 4740
StartUpPosition = 1 'CenterOwner
Begin VB.TextBox txtVGrid
Height = 285
Left = 2535
TabIndex = 3
Text = "2"
Top = 930
Width = 540
End
Begin VB.TextBox txtHGrid
Height = 285
Left = 2535
TabIndex = 2
Text = "2"
Top = 540
Width = 540
End
Begin VB.CheckBox chckSnapToGrid
Caption = "Align shapes to grid"
Height = 360
Left = 1740
TabIndex = 4
Top = 1440
Value = 1 'Checked
Width = 1800
End
Begin VB.CommandButton btnCancel
Caption = "Cancel"
Height = 375
Left = 3825
TabIndex = 7
Top = 630
Width = 870
End
Begin VB.CommandButton btnOK
Caption = "OK"
Height = 375
Left = 3825
TabIndex = 5
Top = 180
Width = 870
End
Begin VB.CommandButton btnGridColor
Caption = "Choose color..."
Height = 360
Left = 45
TabIndex = 1
Top = 795
Width = 1320
End
Begin ColorSelectLib.ColorSelect ctlCSGridColor
Height = 345
Left = 2040
TabIndex = 6
Top = 1425
Width = 435
_Version = 65536
_ExtentX = 767
_ExtentY = 609
_StockProps = 0
End
Begin VB.CheckBox chckShowGrid
Caption = "Show grid"
Height = 360
Left = 195
TabIndex = 0
Top = 195
Value = 1 'Checked
Width = 1245
End
Begin VB.Frame Frame1
Caption = "Grid units: milimeters"
Height = 1680
Left = 1650
TabIndex = 8
Top = 195
Width = 1935
Begin VB.Label lblVGrid
Caption = "&Height:"
Height = 240
Left = 105
TabIndex = 10
Top = 750
Width = 705
End
Begin VB.Label lblHGrid
Caption = "&Width:"
Height = 240
Left = 120
TabIndex = 9
Top = 375
Width = 705
End
End
End
Attribute VB_Name = "frmGrid"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim crGridColor As OLE_COLOR
Dim lGridHeight, lGridWidth As Long
Dim fSnapToGrid, fShowGrid As Boolean
Private Sub btnCancel_Click()
frmDrawVB.POLARDraw1.DrawGrid = fShowGrid
frmDrawVB.POLARDraw1.SnapToGrid = fSnapToGrid
frmDrawVB.POLARDraw1.VerticalGrid = lGridHeight
frmDrawVB.POLARDraw1.HorizontalGrid = lGridWidth
frmDrawVB.POLARDraw1.GridColor = crGridColor
Unload Me
End Sub
Private Sub btnGridColor_Click()
ColorSelectPosition ctlCSGridColor
ctlCSGridColor.SelectColor
End Sub
Private Sub btnOK_Click()
lGridHeight = txtVGrid
lGridWidth = txtHGrid
fSnapToGrid = CBool(chckSnapToGrid.Value)
fShowGrid = CBool(chckShowGrid.Value)
crGridColor = ctlCSGridColor.SelectedColor
frmDrawVB.POLARDraw1.DrawGrid = fShowGrid
frmDrawVB.POLARDraw1.SnapToGrid = fSnapToGrid
frmDrawVB.POLARDraw1.VerticalGrid = lGridHeight
frmDrawVB.POLARDraw1.HorizontalGrid = lGridWidth
frmDrawVB.POLARDraw1.GridColor = crGridColor
Unload Me
End Sub
Private Sub chckShowGrid_Click()
frmDrawVB.POLARDraw1.DrawGrid = CBool(chckShowGrid.Value)
If (CBool(chckShowGrid.Value)) Then
txtHGrid.Enabled = True
txtVGrid.Enabled = True
btnGridColor.Enabled = True
chckSnapToGrid.Enabled = True
Else
txtHGrid.Enabled = False
txtVGrid.Enabled = False
btnGridColor.Enabled = False
chckSnapToGrid.Enabled = False
End If
End Sub
Private Sub ctlCSGridColor_SelectionEndOK()
frmDrawVB.POLARDraw1.GridColor = ctlCSGridColor.SelectedColor
End Sub
Private Sub Form_Load()
fShowGrid = frmDrawVB.POLARDraw1.DrawGrid
fSnapToGrid = frmDrawVB.POLARDraw1.SnapToGrid
lGridHeight = frmDrawVB.POLARDraw1.VerticalGrid
lGridWidth = frmDrawVB.POLARDraw1.HorizontalGrid
crGridColor = frmDrawVB.POLARDraw1.GridColor
chckShowGrid.Value = Abs(fShowGrid)
chckSnapToGrid.Value = Abs(fSnapToGrid)
txtVGrid = lGridHeight
txtHGrid = lGridWidth
ctlCSGridColor.SelectedColor = frmDrawVB.POLARDraw1.GridColor
ctlCSGridColor.SelectedColor = crGridColor
End Sub